<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/common/jsp/taglibs-nojs-nocss.jsp"%>
<%@ page isELIgnored="false" %>
<%
	String path_part = request.getContextPath();
	String basePathter = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path_part + "/";
%>
<style type="text/css">
.bg td{
	font-size:12px;
	text-align:left;
	line-height:15px;
	height:20px;
	table-layout:fixed!important;
}
.bg td.tit{
    background-color:#e2e2e2;
    height:17px;
	text-align:center;
	line-height:15px;
	table-layout:fixed!important;
}
.bg td.num{
    background-color:#e2e2e2;
	text-align:right;
	line-height:15px;
	width:30px;
	height:22px;
	table-layout:fixed!important;
}
.resizeDivClass{
   text-align:right;
   width:2px;
   margin:0px 0 0px 0;
   background:#fff;
   border:2px;
   float:right;
   cursor:e-resize;
   table-layout:fixed!important;
} 
</style>
<body onload="setTableLayoutToFixed()"></body>
<div class="wbs_scroll" style="height:390px;overflow-x:scroll;">
	<table width="100%" style="fixed!important" class="gridview"  border=1 cellspacing=0 id="theObjTable">
			<tr class="title">
				<td width="4%" align="center" class="num" ><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span>序号</td>
				<td width="6%" align="center" class="tit" ><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span>合同编码</td>
				<td width="8%" align="center" class="tit" ><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span>合同名称</td>
				<td width="6%" align="center" class="tit" ><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span>合同金额</td>
				<td width="8%" align="center" class="tit" ><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span>签订日期</td>
				<td width="8%" align="center" class="tit" ><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span>项目名称</td>
				<td width="7%" align="center" class="tit" ><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span>项目单位</td>
				<td width="5%" align="center" class="tit" ><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span>联系人</td>
				<td width="6%" align="center" class="tit" ><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span>电话</td>
				<td width="5%" align="center" class="tit" ><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span>业务员</td>
				<td width="5%" align="center" class="tit" ><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span>质保额</td>
				<td width="6%" align="center" class="tit" ><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span>备货</td>
				<td width="6%" align="center" class="tit" ><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span>发货</td>
				<td width="7%" align="center" class="tit" ><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span>开发票</td>
				<td width="6%" align="center" class="tit" ><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span>回款</td>
				<td class="nowrap" width="20%" >
					操作
				</td>
			</tr>
			<s:if test="wrapperList!=null && wrapperList.size()>0">
				<s:iterator id="wrapperList" value="wrapperList" status="status">
					<tr <s:if test="#status.odd"> class="odd_title" </s:if><s:else>class="even_title "</s:else>>
						<td width="4%"><s:property value="#status.count"/></td>
						<td width="6%">${contractCode}</td>
						<td width="8%">${contractName}</td>
						<td width="6%">${contractMoney}</td>
						<td width="8%">${signDate}</td>
						<td width="8%">${projectName}</td>
						<td width="7%">${projectUnit}</td>
						<td width="5%">${linkMan}</td>
						<td width="6%">${telePhone}</td>
						<td width="5%">${salesManName}</td>
						<td width="5%">${qualityMoney}</td>
						<td width="6%">
							<s:if test="isStockUp==0">
								未备货
							</s:if>
							<s:else>
								已备货
							</s:else>
						</td>
						<td width="6%">
							<s:if test="isDelivery==0">
								未发货
							</s:if>
							<s:else>
								已发货
							</s:else>
						</td>
						<td width="7%">
							<s:if test="isInvoice==0">
								未开发票
							</s:if>
							<s:else>
								已开发票
							</s:else>
						</td>
						<td width="6%">
							<s:if test="remitMoney>0&&remitMoney==contractMoney">
								已回款
							</s:if>
							<s:else>
								未回款
							</s:else>
						</td>
						<td class="nowrap">
							<a class="icon_tools menu_arrow_down" href="javascript:void(0);" onClick="openmenu(this , 'contractAction!gotoContractMenu.action?id=${id}');">▼</a>
				        </td>
					</tr>
				</s:iterator>
			</s:if>
			<s:else>
				<tr>
					<td align="center" colspan="10">
						无记录
					</td>
				</tr>
			</s:else>
	</table>
</div>
<%@include file="../../common/jsp/pageing.jsp" %>
<script>
	// 文本超过8个字符数时，用省略显示
		text_overflow( 10 );
	 	//查询方法
		function searchContractBySearchKey(){
			var projectName = document.getElementById("condition.projectUnit").value;
			var salesMan = document.getElementById("condition.salesMan").value;
			var signDate = document.getElementById("condition.signDate").value;
			var endSignDate = document.getElementById("condition.endSignDate").value;
			location.href=encodeURI('contractAction!findAllContract.action?condition.projectUnit='+projectName+'&condition.salesMan='+salesMan+'&condition.signDate='+signDate+'&condition.endSignDate='+endSignDate);
			//loadContent('_econTargetList_div_id','contractAction!findAllContract.action?condition.projectUnit='+projectName+'&condition.salesMan='+salesMan+'&condition.signDate='+signDate+'&condition.endSignDate='+endSignDate , function(){
			//setGridCss();
			//})
		}
        // 分页
		function gotoPage( pageNo , totalPage , pageSize ){
			// 按page的信息加载数据
			// 如果当前页大于了最大页数就弹出警告
			if( pageNo > totalPage ){
				window.alert( '总页数为'+totalPage+' , 请重新输入页码!' );
				return;
			}
			location.href='contractAction!listContractByPage.action?page.pageNo='+pageNo+'&page.totalPage='+totalPage+'&page.pageSize='+pageSize+'&condition.projectUnit=<s:property value="condition.projectUnit"/>&condition.salesMan=<s:property value="condition.salesMan"/>&condition.signDate=<s:property value="condition.signDate"/>&condition.endSignDate=<s:property value="condition.endSignDate"/>';
			// 加载数据
			//loadContent( '_econTargetList_div_id' , 'contractAction!listContractByPage.action?page.pageNo='+pageNo+'&page.totalPage='+totalPage+'&page.pageSize='+pageSize+'&condition.projectUnit=<s:property value="condition.projectUnit"/>&condition.salesMan=<s:property value="condition.salesMan"/>&condition.signDate=<s:property value="condition.signDate"/>&condition.endSignDate=<s:property value="condition.endSignDate"/>',function() {setGridCss();setGridOddEvenCss();} );
			
		}
</script>
<script language="javascript">
	function MouseDownToResize(obj){
		setTableLayoutToFixed(); 
		obj.mouseDownX=event.clientX; 
		obj.pareneTdW=obj.parentElement.offsetWidth; 
		obj.pareneTableW=theObjTable.offsetWidth; 
		obj.setCapture(); 
	} 
	function MouseMoveToResize(obj){ 
	    if(!obj.mouseDownX) return false; 
	    var newWidth=obj.pareneTdW*1+event.clientX*1-obj.mouseDownX; 
	    if(newWidth>10){
			var theObjTable = document.getElementById("theObjTable");
			obj.parentElement.style.width = newWidth; 
			theObjTable.style.width=obj.pareneTdW*1+event.clientX*1-obj.mouseDownX; 
		} 
	} 
	function MouseUpToResize(obj){ 
		obj.releaseCapture(); 
		obj.mouseDownX=0; 
	} 
	function setTableLayoutToFixed() 
	{
	 var theObjTable = document.getElementById("theObjTable");
	 if(theObjTable.style.tableLayout=='fixed') return; 
	    var headerTr=theObjTable.rows[0]; 
	    for(var i=0;i<headerTr.cells.length;i++){ 
	   		headerTr.cells[i].styleOffsetWidth=headerTr.cells[i].offsetWidth; 
	    } 
	    for(var i=0;i<headerTr.cells.length;i++){ 
	    	headerTr.cells[i].style.width=headerTr.cells[i].styleOffsetWidth; 
	    } 
	    theObjTable.style.tableLayout='fixed'; 
	} 
</script> 